home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best of Shareware
/
Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso
/
mac
/
ZIPPED
/
DOS
/
GRAPHICS
/
POVSRC.ZIP
/
MACHINE.ZIP
/
MAC.SIT
/
stdio_p2w.h
< prev
next >
Wrap
Text File
|
1992-04-24
|
3KB
|
89 lines
/*
==============================================================================
Copyright 1992, esp, All Rights Reserved
------------------------------------------------------------------------------
Project: POV
File Name: stdio_p2w.h
Description:
General-purpose printf-capturing routines that allow a console-like
output window for c programs that otherwise prefer to use printf/fprintf.
This code was "inspired heavily" from sources such as MacDTS'es TESample,
MacApp's Transcript window, and previous code of mine. It is fairly well
self-contained, and works in MPW C 3.2 and Think C 5.0.
This file contains global definitions used by any source files that would
otherwise include <stdio.h>.. that is, non-Macintosh-toolbox-aware. It is
_REQUIRED_ that those files be modified to include "stdio_p2w.h" instead of
<stdio.h>, since this header will include <stdio.h> for them.
NOTE: If stdio.h is included after this header, problems will occur.
Related Files:
stdio_p2w.h - generic header for sources that would otherwise use <stdio.h>
printf2window.h - Mac-specific header for p2w routines
printf2window.c - the main source for the p2w routines
------------------------------------------------------------------------------
Author:
Eduard [esp] Schwan
------------------------------------------------------------------------------
Copyright 1992 POV-Team.
This source code is distributed exclusively with POV, and is subject to
the same distribution restrictions as the rest of the source code.
* Copying, distribution and legal info is in the file povlegal.doc which
* should be distributed with this file. If povlegal.doc is not available
* or for more information please contact:
*
* Drew Wells [POV-Team Leader]
* CIS: 73767,1244 Internet: 73767.1244@compuserve.com
* Phone: (213) 254-4041
*
------------------------------------------------------------------------------
Change History:
920326 [esp] Created.
920330 [esp] Updated file header with copyright & related files info
920424 (jln) removed putc definition to avoid problems writing Targa format.
==============================================================================
*/
#ifndef __stdio_p2w__
#define __stdio_p2w__
#include <stdio.h>
// ==== <stdio.h> replacement macros (Forces std C i/o to call us instead)
#undef fflush
#undef fprintf
#undef fputc
#undef fputs
#undef printf
#undef putc
#undef putchar
#undef puts
#define fflush p2w_fflush
#define fprintf p2w_fprintf
#define fputc p2w_fputc
#define fputs p2w_fputs
#define printf p2w_printf
//define putc p2w_putc -yeah right! not until we get pass-thru to system for non-console.
#define putchar p2w_putchar
#define puts p2w_puts
// ==== Std C library replacement routines
int p2w_fflush(FILE *stream);
int p2w_fprintf(FILE *stream, const char *format, ...);
int p2w_fputc(int theChar, FILE *stream);
int p2w_fputs(const char *theString, FILE *stream);
int p2w_printf(const char * format, ...);
int p2w_putc(int theChar, FILE *stream);
int p2w_putchar(const char theChar);
int p2w_puts(const char *theString);
#endif __stdio_p2w__